<?php
	include 'author.php';
	$user   = $_GET["user"];

	$query 	= "SELECT idx, message, check FROM app_sb_msg WHERE sender='$user'";
	$result = mysql_query($query) or die(mysql_error());

	$output = "{\"sendlist\":[";
	while($data = mysql_fetch_array($result))
	{
		$output .= "{\"index\":\"$data[0]\", \"msg\":\"$data[1]\"}, \"check\":\"$data[2]\"},";
	}

	$output = substr($output, 0, -1);
	$output .= "]}";

	echo "$output";

	mysql_close($dbConn);
?>